package com.lmx.repoDomain.repository;

import io.katharsis.queryParams.QueryParams;
import io.katharsis.repository.annotations.JsonApiFindAll;
import io.katharsis.repository.annotations.JsonApiResourceRepository;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.lmx.common.context.ActionContextHolder;
import com.lmx.persistence.service.FoodPlanDayRecordService;
import com.lmx.repoDomain.tmodel.FoodPlanDayRecord;
import com.lmx.repoDomain.tmodel.unpersis.QueryParam;

/**
 * 老人用餐统计(日)
 *
 * @author ytche
 * @date 2017年9月4日
 *
 */
@Component
@JsonApiResourceRepository(value = FoodPlanDayRecord.class)
public class FoodPlanDayRecordRepository extends
		BaseRepository<FoodPlanDayRecord> {
	@Autowired
	FoodPlanDayRecordService service;

	@Override
	@JsonApiFindAll
	public Iterable<FoodPlanDayRecord> findAll(final QueryParams requestParams) {
		Long tenantId = ActionContextHolder.getContext().getTenantId();
		return this.service.findDayRecord(tenantId, new QueryParam(
				requestParams));
	}
}
